/*
 * Main.java
 * Copyright (C) 2006 Francisco J. Hernández
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the Free
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 * 
 */

package NativeRobot;

import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import java.awt.event.MouseEvent;

/**
 * Programa de ejemplo
 *
 * @author Francisco J. Hdez Hdez
 */
public class Main {
    
    /** Creates a new instance of Main */
    public Main() {
    }
    
    public static void main(String[] args) {
        NativeRobot robot = null;
        try {
            robot = new NativeRobot();
        } catch (Exception e) {
            System.out.println("Error: " + e.getStackTrace());
            System.exit(1);
        }
        robot.setNativeMode(true);
        System.out.println("Mouse: " + robot.getMousePos());
        robot.setNativeMode(true);
        System.out.println("Boton izq: " + robot.isButtonPressed(MouseEvent.BUTTON1));
        robot.setNativeMode(true);
        System.out.println("Pausa: " + robot.isButtonPressed(KeyEvent.VK_PAUSE));
        robot.setNativeMode(true);
        System.out.println(robot.findAllTittleWindow("sist", true));
        System.out.println(robot.findAllTittleWindow("Ultima", true));
        robot.setNativeMode(true);
        System.out.println("Color: " + robot.getPixelColor(100,200));
        robot.setNativeMode(true);
        robot.setActWinTittle(robot.getActWinTittle());
        robot.setNativeMode(true);
        robot.keyPress(java.awt.event.KeyEvent.VK_SHIFT);
        robot.keyPress(java.awt.event.KeyEvent.VK_K);
        robot.mouseMove(620,456);
        robot.mousePress(InputEvent.BUTTON1_MASK);
        robot.mouseRelease(InputEvent.BUTTON1_MASK);
        robot.keyRelease(java.awt.event.KeyEvent.VK_SHIFT);
     }
    
}
